import request from '@/utils/request'

export function page(params) {
    return request({
        url: '/category/page',
        method: 'get',
        params
    })
}
export function list() {
    return request({
        url: '/category/list',
        method: 'get'
    })
}

export function queryById(id) {
    return request({
        url: `/category/${id}`,
        method: 'get'
    })
}

export function updateById(data) {
    return request({
        url: `/category`,
        method: 'put',
        data
    })
}

export function add(data) {
    return request({
        url: `/category`,
        method: 'post',
        data
    })
}

export function deleteById(id) {
    return request({
        url: `/category/${id}`,
        method: 'delete'
    })
}